package com.hp.common.upload;

import com.hp.common.upload.model.UploadResult;
import com.hp.common.upload.model.UploadTokenParam;
import com.hp.common.upload.model.UploadTokenVo;

/**
 * 通过上传接口定义
 */
public interface CommonUpload {
    /**
     * 回调请求类型
     */
    String CALLBACK_BODY_TYPE = "application/json";
    /**
     * 回调请求时会在请求
     */
    String CALLBACK_AUTH_HEADER = "Authorization";

    /**
     * 创建上传凭证
     *
     * @return
     */
    UploadTokenVo createUploadToken(UploadTokenParam param);

    /**
     * 回调处理
     *
     * @param callbackAuthHeader
     * @param callbackUrl
     * @param callbackBody
     * @return
     */
    UploadResult handleCallback(String callbackAuthHeader, String callbackUrl, String callbackBody);
}
